﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ITAP.ContourBuilder.Components;

namespace ITAP.ContourBuilder.Operations
{
    public abstract class OperationWithSelectedConnectors : Operation
    {
        protected List<ContourConnector> connectors;
        public override bool CanUndo
        {
            get
            {
                return true;
            }
        }

        public override void Execute()
        {
            base.Execute();
            connectors = new List<ContourConnector>();
            foreach (IContourComponent component in this.Control.ContourContainer.SelectedComponentsStack)
                if (component is ContourConnector)
                    connectors.Add(component as ContourConnector);
        }
    }
}
